public class User {
    private String userName;
    private String passWord;

    public void login(String userName,String passWord ) throws
            PossWordExcepption
            ,UserNameException{
        if (!this.getUserName().equals(userName)){
            throw new UserNameException("用户名错误");
        }
        if (!this.getPassWord().equals(passWord)){
            throw new UserNameException("密码错误");
        }

        System.out.println("登录成功");
    }

    public String getPassWord() {
        return passWord;
    }

    public void setPassWord(String passWord) {
        this.passWord = passWord;
    }

    public String getUserName() {
        return userName;
    }

    public void setUserName(String userName) {
        this.userName = userName;
    }

//    public User(String userName, String passWord) {
//        this.userName = userName;
//        this.passWord = passWord;
//    }
}
